<!DOCTYPE html>
<html>
    <head>
        <script src="../common/main.js"></script>
        <meta charset="utf-8" />
        <title>代理设置</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style>
            body {
                font-family: Arial, sans-serif;
                line-height: 1.6;
                background-color: #f8f8f8;
                margin: 0;
                padding: 0;
                width: 800px; /* 设置宽度 */
                height: 800px; /* 设置高度 */
            }

            table {
                border-collapse: collapse;
                width: 100%;
                max-width: 800px;
                margin: auto;
                background-color: #fff;
                border-radius: 5px;
                overflow: hidden;
                border: 1px solid #ddd;
            }

            th, td {
                padding: 10px;
                text-align: left;
                border-bottom: 1px solid #ddd;
            }

            th {
                background-color: #f2f2f2;
            }

            input[type="text"], input[type="number"], select {
                padding: 8px;
                width: calc(100% - 16px); /* Adjusted for padding */
                border: 1px solid #ccc;
                border-radius: 4px;
                box-sizing: border-box;
            }

            input[type="radio"], input[type="checkbox"] {
                margin-right: 5px;
                vertical-align: middle;
            }

            input[type="button"] {
                padding: 10px 20px;
                background-color: #4caf50;
                border: none;
                color: white;
                cursor: pointer;
                border-radius: 4px;
                margin-top: 10px;
            }

            input[type="button"]:hover {
                background-color: #45a049;
            }

            /* Collapse the advanced settings by default */
            [name="advanced_settings"] {
                display: none;
            }

            /* Style for the advanced settings label */
            th[name="advanced_settings"] {
                background-color: #f2f2f2;
                padding: 10px;
                cursor: pointer;
            }

            /* Style for the advanced settings row */
            tr[name="advanced_settings"] {
                display: none;
            }

            /* Style for the advanced settings row when expanded */
            tr[name="advanced_settings"].expanded {
                display: table-row;
            }

            /* Style for the bypass list input */
            input[name="bypass_list"] {
                width: calc(100% - 20px);
                margin-top: 5px;
            }
        </style>
    </head>
    <body>
    <table>
        <thead>
            <tr>
                <th colspan="2">代理模式</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>直连模式</td>
                <td><input type="radio" name="mode" id="direct" value="direct"></td>
            </tr>
            <tr>
                <td>自动检测代理模式</td>
                <td><input type="radio" name="mode" id="auto_detect" value="auto_detect"></td>
            </tr>
            <tr>
                <td>自动脚本代理</td>
                <td><input type="radio" name="mode" id="pac_script" value="pac_script"></td>
            </tr>
            <tr>
                <td>手动设置代理模式</td>
                <td><input type="radio" name="mode" id="fixed_servers" value="fixed_servers"></td>
            </tr>
            <tr>
                <td>系统代理模式</td>
                <td><input type="radio" name="mode" id="system" value="system" checked></td>
            </tr>
            <tr>
                <th>自动脚本代理地址</th>
                <td><input type="text" name="pac_url" id="pac_url" value="http://127.0.0.1:10002/proxy.pac"></td>
            </tr>
            <tr>
                <th>手动设置代理地址</th>
                <td><input type="checkbox" name="advanced_settings_checkbox" id="advanced_settings_checkbox" value="false"> 高级设置</td>
            </tr>
            <tr name="simple_settings" style="display:block;">
                <td colspan="2">
                    <table>
                        <tr>
                            <td>设置服务器地址</td>
                            <td><input type="text" name="server_address" id="server_address" value="127.0.0.1"></td>
                        </tr>
                        <tr>
                            <td>端口号</td>
                            <td><input type="text" name="server_port" id="server_port" value="1080"></td>
                        </tr>
                        <tr>
                            <td>设置服务器协议(不懂别点)</td>
                            <td>
                                <select name="server_protocol" id="server_protocol">
                                    <option value="http">http</option>
                                    <option value="https">https</option>
                                    <option value="quic">quic</option>
                                    <option value="socks4">socks4</option>
                                    <option value="socks5" selected >socks5</option>
                                </select>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr name="advanced_settings" style="display:none;">
                <th colspan="2" name="advanced_settings">高级设置</th>
            </tr>
            <tr name="advanced_settings" class="expanded" style="display:none;">
                <td colspan="2">
                    <table>
                        <tr>
                            <td>FTP代理地址</td>
                            <td><input type="text" name="ftp_proxy_address" id="ftp_proxy_address" value="127.0.0.1"></td>
                            <td>端口号</td>
                            <td><input type="number" name="ftp_port" id="ftp_port" value="1080"></td>
                            <td>设置服务器协议(不懂别点)</td>
                            <td>
                                <select name="ftp_server_protocol" id="ftp_server_protocol">
                                    <option value="http">http</option>
                                    <option value="https">https</option>
                                    <option value="quic">quic</option>
                                    <option value="socks4">socks4</option>
                                    <option value="socks5" selected >socks5</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>HTTP代理地址</td>
                            <td><input type="text" name="http_proxy_address" id="http_proxy_address" value="127.0.0.1"></td>
                            <td>端口号</td>
                            <td><input type="number" name="http_port" id="http_port" value="1080"></td>
                            <td>设置服务器协议(不懂别点)</td>
                            <td>
                                <select name="http_server_protocol" id="http_server_protocol">
                                    <option value="http">http</option>
                                    <option value="https">https</option>
                                    <option value="quic">quic</option>
                                    <option value="socks4">socks4</option>
                                    <option value="socks5" selected >socks5</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>HTTPS代理地址</td>
                            <td><input type="text" name="https_proxy_address"  id="https_proxy_address" value="127.0.0.1"></td>
                            <td>端口号</td>
                            <td><input type="number" name="https_port" id="https_port" value="1080"></td>
                            <td>设置服务器协议(不懂别点)</td>
                            <td>
                                <select name="https_server_protocol" id="https_server_protocol">
                                    <option value="http">http</option>
                                    <option value="https">https</option>
                                    <option value="quic">quic</option>
                                    <option value="socks4">socks4</option>
                                    <option value="socks5" selected >socks5</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>其他协议代理</td>
                            <td><input type="text" name="fallback_proxy_address" id="fallback_proxy_address" value="127.0.0.1"></td>
                            <td>端口号</td>
                            <td><input type="number" name="fallback_port" id="fallback_port" value="1080"></td>
                            <td>设置服务器协议(不懂别点)</td>
                            <td>
                                <select name="fallback_server_protocol" id="fallback_server_protocol">
                                    <option value="http">http</option>
                                    <option value="https">https</option>
                                    <option value="quic">quic</option>
                                    <option value="socks4">socks4</option>
                                    <option value="socks5" selected >socks5</option>
                                </select>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    不使用代理的地址(绕行地址)以英文逗号分隔:<br />
                    <textarea name="bypass_list" id="bypass_list" style="width: 100%;height: 50px;">
localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*,*.12306.cn, *.51ym.me, *.52pojie.cn, *.8686c.com, *.abercrombie.com, *.adobesc.com, *.air-matters.com, *.air-matters.io, *.airtable.com, *.akadns.net, *.apache.org, *.api.crisp.chat, *.api.termius.com, *.appshike.com, *.appstore.com, *.aweme.snssdk.com, *.bababian.com, *.battle.net, *.beatsbydre.com, *.bet365.com, *.bilibili.cn, *.ccgslb.com, *.ccgslb.net, *.chunbo.com, *.chunboimg.com, *.clashroyaleapp.com, *.cloudsigma.com, *.cloudxns.net, *.cmfu.com, *.culturedcode.com, *.dct-cloud.com, *.didialift.com, *.douyutv.com, *.duokan.com, *.dytt8.net, *.easou.com, *.ecitic.net, *.eclipse.org, *.eudic.net, *.ewqcxz.com, *.fir.im, *.frdic.com, *.fresh-ideas.cc, *.godic.net, *.goodread.com, *.haibian.com, *.hdslb.net, *.hollisterco.com, *.hongxiu.com, *.hxcdn.net, *.images.unsplash.com, *.img4me.com, *.ipify.org, *.ixdzs.com, *.jd.hk, *.jianshuapi.com, *.jomodns.com, *.jsboxbbs.com, *.knewone.com, *.kuaidi100.com, *.lemicp.com, *.letvcloud.com, *.lizhi.io, *.localizecdn.com, *.lucifr.com, *.luoo.net, *.mai.tn, *.maven.org, *.miwifi.com, *.moji.com, *.moke.com, *.mtalk.google.com, *.mxhichina.com, *.myqcloud.com, *.myunlu.com, *.netease.com, *.nfoservers.com, *.nssurge.com, *.nuomi.com, *.ourdvs.com, *.overcast.fm, *.paypal.com, *.paypalobjects.com, *.pgyer.com, *.qdaily.com, *.qdmm.com, *.qin.io, *.qingmang.me, *.qingmang.mobi, *.qqurl.com, *.rarbg.to, *.rrmj.tv, *.ruguoapp.com, *.sm.ms, *.snwx.com, *.soku.com, *.startssl.com, *.store.steampowered.com, *.symcd.com, *.teamviewer.com, *.tmzvps.com, *.trello.com, *.trellocdn.com, *.ttmeiju.com, *.udache.com, *.uxengine.net, *.weather.bjango.com, *.weather.com, *.webqxs.com, *.weico.cc, *.wenku8.net, *.werewolf.53site.com, *.windowsupdate.com, *.wkcdn.com, *.workflowy.com, *.xdrig.com, *.xiaojukeji.com, *.xiaomi.net, *.xiaomicp.com, *.ximalaya.com, *.xitek.com, *.xmcdn.com, *.xslb.net, *.xteko.com, *.yach.me, *.yixia.com, *.yunjiasu-cdn.net, *.zealer.com, *.zgslb.net, *.zimuzu.tv, *.zmz002.com, *.samsungdm.com
                    </textarea>
                </td>
            </tr>
        </tbody>
    </table>
    <input type="button" id="save_button" value="√保存">
    <input type="button" id="set_button" value="√设置">
    <input type="button" id="reset_button" value="√重置">
    </body>
</html>
